<?php 
	header("Content-Type:text/html; charset=utf-8");
   include("global.php");
   sleep(5);

$name=$_REQUEST['username'];
$content = $_REQUEST['content'];

if($name||$content) 
{
    $rs=$db->query("INSERT INTO `mc_photo_comments` (
`id` ,
`fid` ,
`username` ,
`content` 
)
VALUES (
'$id', '$fid', '$name','$content'
)");
}


/*
if($rs)
{
    echo "yes";
}else{
    
    echo "fall".mysql_error();
    }
*/
//$q
//$q=$db->query("select * from mc_photo_comments where id=1");

//$rsdb = $db->get_one("select * from mc_photo_comments where id=1");

$sql ="select * from mc_photo_comments where id=$id order by cid desc";

$query = mysql_query($sql);

while($rs=mysql_fetch_array($query)) 
{
    echo "<div class='comment'><div class='bar'><a href='#'>{$rs[username]}</a>&nbsp;&nbsp;2010-03-24</div><div class='content'><span class='commentText'>{$rs[content]}<br /><div class='quote'>Write:<br />This is the quote:</div></span><span class='reply'><a href='#commentForm'>Reply:</a></span></div>";
}

/*
function get_listpic_info()
{
	global $db,$fid,$sql;
	$query = $db->query($sql);
	while ($rs=$db->fetch_array($query)) 
	{
		//$rs[posttime]=date("Y-m-d",$rs[full_time]=$rs[posttime]);
		$listdb[]=$rs;
	}
	return $listdb;
}
*/

/*

while($rsdb = $db->get_one("select * from mc_photo_comments where id=1")) 
{
    echo "<div class='comment'><h6>{$rsdb[username]}:</h6><p class='para'>{$rsdb[content]}</p></div>";
}
*/
/*
foreach($rsdb as $key=>$rs){
    
    echo "<div class='comment'><h6>{$rs[username]}:</h6><p class='para'>{$rsdb[content]}</p></div>";
    }
*/
	//echo "<div class='comment'><h6>{$_REQUEST['username']}:</h6><p class='para'>{$_REQUEST['content']}</p></div>";
?>
